﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AssignRoles.aspx.cs" Inherits="Role_AssignRoles" %>

<%@ Register TagPrefix="Site" TagName="Header" Src="Header.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>AssignRoles</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript">
		    function RemoveRole(roleID) {
		        if (confirm("Do you want to delete this news?")) {
		            document.all.RoleIDHidden.value = roleID;
		            __doPostBack('RemoveFromRole', '');
		        }
		    }
		</script>
	</HEAD>
	<body bgcolor="black">
		<form id="Form1" method="post" runat="server">
			<input type="hidden" runat="server" id="RoleIDHidden">
			<asp:Button id="RemoveFromRole" runat="server" Visible="False"></asp:Button>
			<div style="WIDTH: 300px; BACKGROUND-COLOR: white">
				<Site:Header runat="server" id="Header"></Site:Header>
				<div style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; PADDING-BOTTOM: 2px; COLOR: white; PADDING-TOP: 2px; BACKGROUND-COLOR: #336699">Assign 
					Roles</div>
				<table width="100%" bgcolor="gray" style="BORDER-BOTTOM: black 1px solid">
					<tr>
						<td>New Role</td>
					</tr>
				</table>
				<table width="100%">
					<tr>
						<td width="100">Role Name</td>
						<td><asp:DropDownList Width="100%" Runat="server" ID="RoleList"></asp:DropDownList></td>
					</tr>
					<tr>
						<td></td>
						<td><asp:Button Width="80" Runat="server" ID="AddRole" Text="Assign"></asp:Button></td>
					</tr>
				</table>
				<table width="100%" bgcolor="gray" style="BORDER-BOTTOM: black 1px solid">
					<tr>
						<td>Current Roles</td>
					</tr>
				</table>
				<asp:Repeater id="RolesRepeater" runat="server">
					<ItemTemplate>
						<table>
							<tr>
								<td><%# DataBinder.Eval(Container.DataItem, "RoleName")%></td>
								<td align="right"><a href='<%# string.Format("javascript:RemoveRole(\"{0}\")", DataBinder.Eval(Container.DataItem, "RoleID")) %>'>Xóa</a></td>
							</tr>
						</table>
					</ItemTemplate>
				</asp:Repeater>
			</div>
		</form>
	</body>
</HTML>
